package com.atgion.manager.mapper;

import com.atgion.spzx.model.entity.system.SysResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysResourceMapper extends BaseMapper<SysResource> {

    List<SysResource> getUserRoutes(String id);

    List<String> getUserPermissions(Long id);
    
    /**
     * 检查用户是否拥有特定权限
     * @param userId 用户ID
     * @param permission 权限标识
     * @return 拥有权限返回1，否则返回0
     */
    Integer checkUserPermission(@Param("userId") Long userId, @Param("permission") String permission);
}
